<template>
  <div class="shop-class">
    <div class="shop-head">
      <easy-head :headName="headName" :returnUrl="returnUrl"></easy-head>
    </div>
    <div>
      <!--
            <v-header :seller="seller"></v-header>
      -->
      <!-- <div class="tab border-1px-bottom">
         <div class="tab-item">
           <router-link to="/goods">商品</router-link>
         </div>
       </div>-->
      <goods :seller="seller" :reqUrl="reqUrl"></goods>
    <!--  <keep-alive>
        <router-view :seller="seller"></router-view>
      </keep-alive>-->
    </div>
  </div>
</template>

<script>
  import easyHead from "../easyHead/easyHead"
  import goods from "../goshopping/goods/goods"
  import {urlParse} from '../../pages/goshopping/common/js/util'
  import header from '../goshopping/header/header.vue'

  export default {
    name: "goshopping",
    components: {
      easyHead,
      goods,
      "v-header": header

    },
    data() {
      return {
        reqUrl:"../../../../static/data.json",
        returnUrl:"/index",
        headName: "点了就送",
        seller: {
          id: (() => {
            let queryParam = urlParse()
            return queryParam.id
          })()
        }
      }
    },
    created() {
      // this.$http.get('/api/seller?id=' + this.seller.id).then((response) => {
      //   response = response.body
      //   if (response.errno === ERR_OK) {
      //     this.seller = Object.assign({}, this.seller, response.data)
      //   }
      // })
      console.log(this.seller
      )
      this.$http.get('../../../../static/data.json', {
        params: {
          id: this.seller.id
        }
      }).then((res) => {
        this.seller = Object.assign({}, this.seller, res.data.seller)
      })

    },
  }
</script>

<style scoped>

</style>
